<form class="<?php echo $this->element->getAttrib('class'); ?>" name="<?php echo $this->element->getName();?>" method="<?php echo $this->element->getMethod(); ?>" action="<?php echo $this->element->getAction() ?>" enctype="<?php echo $this->element->getEnctype() ?>" autocomplete="<?php echo $this->element->getAttrib('autocomplete'); ?>">
<div class="float-left" style="width: 70%;">
<?php
echo $this->element->Title->renderViewHelper(), '<br />';
echo $this->element->Content->getLabel(), '<br />';
/*echo '<span class="editor-toolbar-button bold"></span>','<span class="editor-toolbar-button italic"></span>','<span class="editor-toolbar-button underline"></span>','<span class="editor-toolbar-button left"></span>',
		'<span class="editor-toolbar-button center"></span>','<span class="editor-toolbar-button right"></span>','<span class="editor-toolbar-button bullet"></span>','<span class="editor-toolbar-button numbered"></span>',
		'<span class="editor-toolbar-button html"></span>','<span class="editor-toolbar-button code"></span>','<span class="editor-toolbar-button quoted"></span>','<span class="editor-toolbar-button hyperlink"></span>',
		'<span class="editor-toolbar-button image"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>',
		'<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>',
		'<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>',
		'<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>','<span class="editor-toolbar-button"></span>';*/
echo '<div class="defaultSkin"><span class="mceIcon mce_bold editor-button" command="bold"></span>',
		'<span class="mceIcon mce_italic editor-button" command="italic"></span>',
		'<span class="mceIcon mce_underline editor-button" command="underline"></span>',
		'<span class="mceIcon mce_justifyleft editor-button" command="justifyleft"></span>',
		'<span class="mceIcon mce_justifycenter editor-button" command="justifycenter"></span>',
		'<span class="mceIcon mce_justifyright editor-button" command="justifyright"></span>',
		'<span class="mceIcon mce_justifyfull editor-button" command="justifyfull"></span>',
		'<span class="mceIcon mce_image" command="mceAdvImage"></span>',
		'<span class="mceIcon mce_media" command="mceMedia"></span>',
		'<span class="mceIcon mce_pagebreak editor-button" command="mcePageBreak"></span>',
		/*'<span class="mceIcon mce_italic"></span>',
		'<span class="mceIcon mce_italic"></span>',
		'<span class="mceIcon mce_italic"></span>',
		'<span class="mceIcon mce_italic"></span>',
		'<span class="mceIcon mce_italic"></span>',
		'<span class="mceIcon mce_italic"></span>',
		'<span class="mceIcon mce_italic"></span>',*/
		'<span class="mceIcon mce_code" command="code"></span></div>';


echo $this->element->Content->renderViewHelper(), '<br />';
echo $this->element->submit->renderViewHelper();
?>
</div>
<div class="float-right" style="width: 30%;">
<?php

echo $this->element->Published->getLabel(), '<br />';
echo $this->element->Published->renderUiWidgetElement(), '<br />';
//echo $this->element->Status->getLabel(), '<br />';
echo $this->element->Status->renderViewHelper(), $this->element->Status->getLabel(), '<br />';
echo $this->element->Tags->getLabel(), '<br />';
echo $this->element->Tags->renderViewHelper(), '<br />';
?>
</div>
</form>
<script>
	$(function(){
		$('.editor-button').click(function(){
			tinyMCE.activeEditor.execCommand($(this).attr('command'));
			//$('#Content_' + $(this).attr('command')).parent().click();
		});
		
		$('.mceIcon[command=code]').click(function(){
			alert('test');
		});
		
		$('.mceIcon[command=mceAdvImage]').fancybox({
			type: 'iframe',
			href: '<?php echo $this->url(array('controller' => 'media', 'action' => 'list', 'embed' => true, 'type' => 'image'));?>'
		});
		
		$('.mceIcon[command=mceMedia]').fancybox({
			type: 'iframe',
			href: '<?php echo $this->url(array('controller' => 'media', 'action' => 'list', 'embed' => true, 'type' => 'media'));?>'
		});
			
		//});
	});
	//$(document).ready(function(){$('.defaultSkin').removeClass('hide');});
	$('.tiny-mce').tinymce({
		script_url : '<?php echo $this->baseUrl('/themes/simple/js/tiny_mce/tiny_mce.js');?>',
		plugins : "<?php echo $this->plugins;?>",
		// Theme options
		<?php foreach ($this->toolbars as $k => $v) {?>
		theme_advanced_buttons<?php echo ($k + 1);?> : "<?php echo $v;?>",
		<?php } ?>
		//theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		//theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		theme_advanced_resize_horizontal : false,
		pagebreak_separator: '<!-- nextpage -->',
		content_css : '<?php echo $this->baseUrl('/themes/simple/css/global.css');?>',
		//init_instance_callback: function (inst) { inst.execCommand('mceAutoResize'); }
	});
</script>